home *** CD-ROM | disk | FTP | other *** search
/ Web Designer 98 (Professional) / WebDesigner 1.0.iso / htmled1 / inp11db16.exe / data.z / edi.infile < prev    next >
Encoding:
Internet Message Format  |  1996-10-10  |  2.1 KB

  1. From: WEBPO@harbinger.net
  2. Subject: [EDI WebPO for $CompanyName$]
  3.  
  4. $outvar(devnull)
  5. <!--------------------------------------------------------------------
  6.     po/edi.infile - Blend infile used to produce the edi 850 mail file
  7.                         which is used to interface between WebPO and 
  8.                         email.
  9.     
  10.     1996-09-25 RKJ-000    Original version
  11. -->
  12. $endout
  13. ----BEGIN EDI----
  14. $outfile("/dev/null")
  15.     $set(xphone,$infile("regexp.blendmac",$phone,"[-\.() ]","\0"))
  16.     $set(xinstructions,$infile("regexp.blendmac",$instructions,"\n","\0"))
  17.     $set(yymmdd,$cdate(0,"%y%m%d"))
  18.     $set(hhmm,$cdate(0,"%H%M"))
  19.     $set(segmentCount,5)
  20. $endout$ISA*00*0000000000*00*0000000000*12*$fmt("%15.15s","$xphone             ","string")*ZZ*$fmt("%15.15s","$SellerID          ","string")*$yymmdd$*$hhmm$*00300*U*000000001*0*P*: 
  21. GS*PO*$fmt("%.12s",$xphone,"string")*$fmt("%.12s",$SellerID,"string")*$yymmdd$*$hhmm$*1*X*003010HNS
  22. ST*850*0001
  23. BEG*00*SA*$poNumber$*$yymmdd$
  24. $if($CuName)$if($CustomerID)N1*BY*$CuName$*91*$CustomerID$$inc(segmentCount)$else$N1*BY*$CuName$$inc(segmentCount)$endif$$endif
  25. $if($address1)N3*$address1$$if($address2)*$address2$$endif$$inc(segmentCount)$endif
  26. N4*$City$*$State$*$zip$*$country$
  27. $if($and($Contact,$email))PER*IC*$Contact$*EM*$email$$inc(segmentCount)$endif$PER*IC**TE*$phone$$if($instructions)NTE*GEN*$xinstructions$$inc(segmentCount)$endif
  28. $outfile("/dev/null") 
  29.     $set(loop,0)
  30.     $set(bigTotal,0)
  31.     $set(itemCount,1)
  32.     $while($not($equal($ProductCount,$loop)))
  33.         $if($var(ItemUnits$loop$)) 
  34.             $set(aVal,$var(ItemUnits$loop$)) 
  35.         $else
  36.             $set(aVal,0)
  37.         $endif
  38.         $if($gt($aVal,0))
  39.             $set(aTotal,$mult($aVal,$var(ItemCost$loop$)))
  40.             $outvar(lineitem$itemCount$)PO1*$itemCount$*$aVal$*EA*$var(ItemCost$loop$)***VN*$var(ItemCode$loop$)
  41. $endout
  42.             $inc(itemCount) 
  43.             $set(bigTotal,$add($aTotal,$bigTotal))
  44.         $endif
  45.         $inc(loop) 
  46.     $endwhile
  47. $endout$$set(loop,0)$while($not($equal($itemCount,$loop)))$var(lineitem$loop$)$inc(loop)$endwhile$CTT*$fmt("%.d",$minus($itemCount,1),"int")
  48. SE*$fmt("%.d",$add($itemCount,$segmentCount),"int")*0001
  49. GE*1*1
  50. IEA*1*000000001
  51. ----END EDI----